<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><?php echo $this->translate('选择商品'); ?> <?php if ($this->exclude == 'serialNumber') echo '<small class="text-blue">'.$this->translate('不包含序列号商品').'</small>'; ?></h4>
    </div>
    <div class="modal-body box-body table-responsive no-padding">
        <table class="table table-hover">
            <thead>
            <tr>
                <td colspan="5">
                    <div class="col-xs-12 form-group">
                        <div class="col-sm-3">
                            <select name="searchGoodsCategoryId" id="searchGoodsCategoryId" class="form-control input-sm">
                                <?php foreach ($this->goodsCategoryList as $categoryId => $categoryValue) { ?>
                                <option value="<?php echo $categoryId; ?>" <?php if ($this->searchGoodsCategoryId == $categoryId) echo 'selected'; ?>><?php echo $categoryValue; ?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="col-sm-7">
                            <input type="text" name="searchGoodsName" id="searchGoodsName" class="form-control input-sm" placeholder="<?php echo $this->translate('输入商品编号或商品名称'); ?>" value="<?php echo $this->searchGoodsName;?>">
                        </div>
                        <div>
                            <button type="button" class="btn btn-primary btn-sm" onclick="searchGoods();"><?php echo $this->translate('搜索'); ?></button>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <th width="2%"><input type="checkbox" class="minimal select-all-checkbox"></th>
                <th width="15%"><?php echo $this->translate('商品编号'); ?></th>
                <th><?php echo $this->translate('商品名称'); ?></th>
                <th><?php echo $this->translate('商品规格'); ?></th>
                <th width="10%"><?php echo $this->translate('操作'); ?></th>
            </tr>
            </thead>
            <tbody>
            <?php if($this->goodsList) foreach ($this->goodsList as $goods) { ?>
                <tr>
                    <td><input  name="select_id[]" value="<?php echo $goods->getGoodsId(); ?>" type="checkbox" class="minimal"></td>
                    <td><?php echo $this->escapeHtml($goods->getGoodsNumber()); ?></td>
                    <td>
                        <?php if (!empty($goods->getGoodsImage())) { ?><img src="<?php echo $this->storeHelper()->goodsImage($goods->getGoodsImage()); ?>" class="img-thumbnail" style="<?php echo $this->adminHelper()->defaultGoodsImageWidth(); ?>float:left;margin-right: 3px;"><?php } ?>
                        <?php echo $this->escapeHtml($goods->getGoodsName()); ?>
                        <?php if ($goods->getGoodsSerialNumberState() == 1) { ?>
                            <span class="badge bg-green"><?php echo $this->translate('序列号'); ?></span>
                        <?php } ?>
                    </td>
                    <td><?php echo empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec()); ?>
                    </td>
                    <td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?php echo $goods->getGoodsId(); ?>);"><?php echo $this->translate('点击添加'); ?></button></td>
                </tr>
            <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2"><input type="checkbox" class="minimal select-all-checkbox"> <?php echo $this->translate('全选'); ?></td>
                    <td colspan="3">
                        <?php echo $this->paginationControl($this->goodsList,
                            'Sliding',
                            'layout/ajaxPage',
                            ['route' => 'goods', 'action' => 'ajaxGoodsSearch', 'showDivId' => 'addGoodsListBody']); ?>
                    </td>
                </tr>
            </tfoot>

        </table>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm" onclick="addMoreSelectGoods();"><?php echo $this->translate('选择商品添加'); ?></button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><?php echo $this->translate('关闭'); ?></button>
    </div>
</div>
<script src="<?php echo $this->basePath('js/common.js'); ?>?t=<?php echo time(); ?>" ></script>